package org.future.wsdl.data;

import java.util.ArrayList;
import java.util.List;

import javax.xml.namespace.QName;

/**
 * wsdl:message 元素信息
 * @author dycc
 *
 */
public class WsdlMessage {
    
    private String name;
    
    private String partName;
    
    private QName partEleQName;
    
    private List<String> nameAndtype = new ArrayList<String>();
    
    private WsdlOperation wsdlOperation;
    
    private List<XElementInner> innerEleList = new ArrayList<XElementInner>();
    
    // name 
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    // partName
    public String getPartName() {
        return partName;
    }
    public void setPartName(String partName) {
        this.partName = partName;
    }
    // partEleQName
    public QName getPartEleQName() {
        return partEleQName;
    }
    public void setPartEleQName(QName partEleQName) {
        this.partEleQName = partEleQName;
    }
    // wsdlOperation
    public WsdlOperation getWsdlOperation() {
        return wsdlOperation;
    }
    public void setWsdlOperation(WsdlOperation wsdlOperation) {
        this.wsdlOperation = wsdlOperation;
    }
    // nameAndtype
    public List<String> getNameAndtype() {
        return nameAndtype;
    }
    public void setNameAndtype(List<String> nameAndtype) {
        this.nameAndtype = nameAndtype;
    }
    // innerEleList
    public List<XElementInner> getInnerEleList() {
        return innerEleList;
    }
    public void setInnerEleList(List<XElementInner> innerEleList) {
        this.innerEleList = innerEleList;
    }
    
    /**
     * toString
     */
    public String toString(){
       StringBuffer sb = new StringBuffer();
       sb.append("<wsdl:message name=\"" + name + "\"");
       if(partName == null){
           sb.append(" />");
       }else if(partEleQName != null){
           sb.append(">");
           sb.append("\n");
           sb.append("<wsdl:part name=\"" + partName + "\"");
           sb.append(" element=\"" + partEleQName.getPrefix() + ":" + partEleQName.getLocalPart() + "\"");
           sb.append(" />");
           sb.append("\n");
           sb.append("</wsdl:message>");
       }
       return sb.toString();
    }
}
